Hello,
Thanks for your detailed explanation.
...yes, please file a bug on this and post the bug number back here.
Sharing your bug number regarding this topic which I previously filed.
FB21561068
https://feedbackassistant.apple.com/feedback/21561068
What's the scenario it's failing at?
When determining whether the URL is in “trash” location by using API with the following steps, we are seeing a failure.
Precondition:
Download the attached sample project (TrashedFileURL.zip) in the feedback which I shared with you in above and build the TrashedFileURL.app from the project inside the zip folder.
1.Create a file in NSDocumentDirectory by TrashedFileURL.app.
a.file:///private/var/mobile/Containers/Data/Application/{Application UUID}/Documents/{File UUID}.txt
2.Save the Bookmark of the file created in 1. in TrashedFileURL.app.
3.Delete the file by Files.app.
4.Get URL of the file from the Bookmark which is saved on TrashedFileURL.app.
a.URL is referring a filepath which is inside of .Trash directory.
file:///private/var/mobile/Containers/Data/Application/{Application UUID}/Documents/.Trash/{File UUID}.txt
5.When running [NSFileManager URLForDirectory:NSTrashDirectory inDomain:NSUserDomainMask appropriateForURL:url create:error:] to the URL which got in 4., it will return the following Error.
Error Domain=NSCocoaErrorDomain Code=3328 "The requested operation couldn’t be completed because the feature is not supported."
6.When running [NSFileManager getRelationship:ofDirectory:NSTrashDirectory inDomain:NSUserDomainMask toItemAtURL:error:] to the URL which got in 4., it will return the following Error.
Error Domain=NSCocoaErrorDomain Code=256 "The file couldn’t be opened."
If you need any additional information, please let me know.
Topic:
App & System Services
SubTopic:
Core OS
Tags: